﻿@model IEnumerable<SESM.DTO.EntityUser>
@{
    ViewBag.Title = "User List";
}
<table class="table table-striped table-hover">
    <tr>
        <th>
            Login
        </th>
        <th>
            Email
        </th>
        <th>
            Super Admin
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Login)
            </td>

            <td>
                @Html.DisplayFor(modelItem => item.Email)
            </td>
            <td>
                @if (item.IsAdmin)
                {
                    <span class="glyphicon glyphicon-ok-sign green"></span>
                }
                else
                {
                    <span class="glyphicon glyphicon-remove-sign red"></span>
                }
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.Id })
                @Html.ActionLink("Delete", "Delete", new { id = item.Id }, new { onclick = "return confirm('Are you sure you want to delete this user?');" })
            </td>
        </tr>
    }

</table>
